import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import EpubRead from '../views/EpubRead.vue'

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
    redirect: '/myBooks',
    children: [{
      path: '/myBooks',
      name: 'myBooks',
      component: import('../views/MyBook.vue')
    }, {
      path: '/bookStore',
      name: 'bookStore',
      component: import('../views/BookStore.vue')
    }, {
      path: '/myInfo',
      name: 'myInfo',
      component: import('../views/MyInfo.vue')
    }]
  },
  {
    path: '/pdf',
    name: 'pdf',
    component: () => import(/* webpackChunkName: "about" */ '../views/PdfRead.vue')
  },
  {
    path: '/epub',
    name: 'epub',
    component: EpubRead
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
